package com.sxt.obj;

import java.awt.*;

public class ExplodeObj extends GameObj{
    //定义一个image类型的静态数组
    static Image[] pic=new Image[16];
    //定义变量 让图片只显示一次
    int explodeCount=0;
    static {
        for (int i = 0; i < pic.length; i++) {
            pic[i]=Toolkit.getDefaultToolkit().getImage("imgs/explode/e"+(i+1)+".gif");
        }
    }
    public ExplodeObj(int x, int y) {
        super(x, y);
    }

    @Override
    public void paintSelf(Graphics gImage) {
        super.paintSelf(gImage);
        if(explodeCount<16){
            img =pic[explodeCount];
            super.paintSelf(gImage);
            explodeCount++;
        }
    }
}
